<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	NoticeForm form = (NoticeForm)request.getAttribute("command");
	String group = StringUtils.isNotBlank(form.getGroup())?form.getGroup():Constants.NOTICE_GROUP_NOTICE;
	String userName = SecurityContextHolder.getContext().getAuthentication().getName();
	String nowDate = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss");
	
	TblOaNotice notice = null;
	if(null!=request.getAttribute("notice")){
		notice = (TblOaNotice)request.getAttribute("notice");
	}
%>

<div>
	<form id="noticeAddForm" target="_coreIframe" method="post" action="<%=request.getContextPath()%>/notice/doEdit" enctype="multipart/form-data">
		<div class="breadcrumb">
			<div class="bcIcon"></div>
			<ul class="bcNav">
				<li>编辑营运日报</li>
			</ul>
		</div>
		<input type="hidden" name="noticeId" value="<%=EncrypTool.encode(notice.getNoticeId()+"")%>">
		<input type="hidden" name="group" value="1">
		<table class="formTable">
			<tr>
				<td class="tdTitle">公告类型：</td>
				<td>
					<select disabled="disabled">
						<option value="0" <%=StringUtils.equalsIgnoreCase("0", notice.getNoticeGroup())?"selected=selected":""%> >内部公告</option>
						<option value="1" <%=StringUtils.equalsIgnoreCase("1", notice.getNoticeGroup())?"selected=selected":""%>>营运日报</option>
					</select>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">发布时间：</td>
				<td><input class="inputText xs" type="text"   disabled="disabled" value="<%=(null!=notice.getPublicTime())?DateFormatUtils.format(notice.getPublicTime(), "yyyy-MM-dd HH:mm:ss"):""%>"></td>
			</tr>
			<tr>
				<td class="tdTitle">发布人：</td>
				<td>
					<input class="inputText xs" type="text" value="<%=notice.getPublicMan() %>" name="publicMan">
					<span class="errorTipWrap" id="errorTip_publicMan"></span>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">标题：</td>
				<td>
					<input class="inputText l" type="text" value="<%=notice.getTitle() %>" name="title">
					<span class="errorTipWrap" id="errorTip_title"></span>
				</td>
			</tr>
			<%-- <tr>
				<td class="tdTitle">可选属性：</td>
				<td class="" colspan="2">
					<div class="checkbox-wrap">
						<label>
							<input type="checkbox" value="1" name="istop" class="checkbox"
								<%=StringUtils.equalsIgnoreCase("1", notice.getIstop())?"checked=checked":""%>
							>
							<span>置顶</span>
						</label>
						<label>
							<input type="checkbox" value="1" name="isimportant" class="checkbox"
								<%=StringUtils.equalsIgnoreCase("1", notice.getIsimportant())?"checked=checked":""%>
							>
							<span>重要</span>
						</label>
					</div>
				</td>
			</tr> --%>
			<tr>
				<td class="tdTitle">详细内容：</td>
				<td class="" colspan="2">
					<div style="padding-top:10px;padding-bottom:10px;">
					<textarea id="notice_content" name="content"  class="notice_content"
					style=" visibility: hidden;"><%=notice.getContent() %></textarea>
					</div>
					<span class="errorTipWrap" id="errorTip_content"></span>
				</td>
			</tr>
			
			<%-- <%
			if(StringUtils.equalsIgnoreCase("0", notice.getNoticeGroup())){
				%>
					<tr s='0'>
						<td class="tdTitle">主送：</td>
						<td><input class="inputText xs" type="text" value="<%=StringUtils.isNotBlank(notice.getSendto())?notice.getSendto():""%>" name="sendTo"></td>
					</tr>
					<tr s='0'>
						<td class="tdTitle">抄送：</td>
						<td><input class="inputText xs" type="text" value="<%=StringUtils.isNotBlank(notice.getCopyto())?notice.getCopyto():""%>" name="copyTo"></td>
					</tr>
					<tr s='0'>
						<td class="tdTitle">发文：</td>
						<td><input class="inputText xs" type="text" value="<%=StringUtils.isNotBlank(notice.getPublicDepart())?notice.getPublicDepart():""%>" name="publicDepart"></td>
					</tr>
				<%
			}
			%> --%>
			
			<tr>
				<td class="tdTitle"></td>
				<td>
					<div>
						<input class="input-btn-microsoft" type="submit" value="提交">
						<a class="a-btn-microsoft" href="javascript:XF.Notice.managelistNotice(<%=group%>)">取消</a>
					</div>
				</td>
			</tr>	
		</table>
	</form>
	<iframe id="_coreIframe" name="_coreIframe" style="display: none;"></iframe>
</div>
<script type="text/javascript">
	$(function() {
		XF.createKindEditor("notice_content");
		$("input[name=title]").focus();//主动指定焦点，防止ie的bug
		XF.Notice.init();
	});
</script>



